package ruifeng.zcj.communcationring.ui.reward;

import android.util.Log;
import android.webkit.WebView;

import ruifeng.zcj.communcationring.R;
import ruifeng.zcj.communcationring.base.BaseFragment;
import ruifeng.zcj.communcationring.base.WebViewFragment;
import ruifeng.zcj.communcationring.groble.FragmentArgs;
import ruifeng.zcj.communcationring.groble.Whole;
import ruifeng.zcj.communcationring.ui.LoginRegisterActivity;
import ruifeng.zcj.communcationring.ui.recruit.RecruitActivity;

/**
 * 悬赏+
 * Created by Administrator on 2016/8/22 0022.
 */
public class RewardFragment extends WebViewFragment {
    public static final String FILM_URL = "RewardFragment";

    @Override
    protected String LoadUrl() {
        return Whole.web_reward;
    }

    // 切换到其他Fragment
    @Override
    protected void onUserInvisible() {
        mWebview.stopLoading();
    }


    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        if (!url.equals(Whole.web_recruit) && !url.equals(Whole.wk)) {// 如果不等于学院
//            Log.e("zcj", url);
            FragmentArgs fragmentArgs = new FragmentArgs();
            fragmentArgs.add("CircleFragment", url);
            if (url.equals(Whole.Register2)) {// 登录选择用户
                LoginRegisterActivity.launch(getBaseActivity(), RewardFragment.class, fragmentArgs);
            } else {
                RewardActivity.launch(getBaseActivity(), RewardFragment.class, fragmentArgs);
            }
        }
        return false;
    }
}
